package com.example.web;

import com.example.entity.ChinaArea;
import com.example.entity.User;
import com.example.service.ChinaAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title: spring-boot-druid
 * @Package com.example.web
 * @Date 2018/5/9下午2:56
 * @Author PX ye
 * @E-mail yepx2013@gmail.com
 * @Company http://www.yiautos.com
 * @Description: ${todo}
 */
@RestController
@RequestMapping("/chinaArea")
public class ChinaAreaController {

    @Autowired
    private ChinaAreaService chinaAreaService;

    @RequestMapping("/chinaAreaAll")
    List<ChinaArea> chinaAreaAll(){

        return chinaAreaService.getChinaAreaAll();
    }


    @RequestMapping("/chinaAreaById")
    ChinaArea chinaAreaById(@RequestParam Long id){

        return chinaAreaService.getChinaAreaById(id);
    }
}
